<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
    <div class="w790">
        <script>
            function uploaded(path){
                $("#img_url").attr("src",'__PUBLIC__'+path);
                $("input[name='img_url']").val(path);
            }
            function del_img(){
                if(confirm('您确定要删除图片吗?')){
                    var file=$("input[name='img_url']").val();
                    $.post("{:U('delImgBypath')}",{'path':file},function(data){
                        $("input[name='img_url']").val('');
                        $("#img_url").attr('src','');
                    });
                }else{
                    return false;
                }
            }
            //切换栏目方式
            function parseCateType(e){
                if($(e).val()==1){
                    $('#pagesize').show();
                }else{
                    $('#pagesize').hide();
                }
            }
            function after(e){
                $(e).parent().parent().parent().parent().parent('li').after($(e).parent().parent().parent().parent().parent('li').prev());
            }
            function append(e){
                $(e).parent().parent().parent().parent().parent('li').next().after($(e).parent().parent().parent().parent().parent('li'));
            }
            function delnews(e){
                $(e).parent().parent().parent().parent().parent().remove();
            }
            function addnews(){
                var html = $('#copyHTML').html();
                $(html).appendTo('#replyList ul');
            }


            function getExtends(e){
                var v = $('#extendsList'+$(e).val()).val();
                $('#extends').val(v);
            }
        </script>
        <style>
            #replyList ul li{margin-top:5px; background:#eee; padding:8px; width:700px;}
            .delnews{display:block; width:30px; font-size:20px; height:30px; border-radius:15px; background:#f00; color:#fff; line-height:30px; text-align:center;}
        </style>

        <div class="h"><a href="{:U('index')}" class="btn btn-info"><i class="glyphicon glyphicon-circle-arrow-left"></i> 返回供货商列表</a>

        </div>
        <form class="checkoutform1 form-horizontal" action="{:U('insert')}" method="post">
            <div class="table_ container">





                <div class="form-group">
                    <label class="col-sm-2 control-label">名称</label>
                    <div class="col-sm-10">
                        <input class="form-control" datatype="*" value="" name="susername" type="text" placeholder="供货商名称">
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-sm-2 control-label">电话</label>
                    <div class="col-sm-10">
                        <input class="form-control" name="sphone" value="" type="text" placeholder="电话">
                    </div>
                </div>



                <div class="form-group">
                    <label class="col-sm-2 control-label">地区</label>
                    <div class="col-sm-10">
                        <span id="areabox"></span>
                    </div>
                </div>





                <div class="form-group">
                    <label class="col-sm-2 control-label">地址</label>
                    <div class="col-sm-10">
                        <input class="form-control" value="" name="saddress" type="text" placeholder="地址">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">联系人</label>
                    <div class="col-sm-10">
                        <input class="form-control" value="" name="contacts" type="text" placeholder="联系人">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">备注</label>
                    <div class="col-sm-10">
                        <input class="form-control" value="" name="remark" type="text" placeholder="备注">
                    </div>
                </div>


            </div><div class="pages"><button type="submit" class="btn btn-success">保存</button></div>
        </form>
    </div>
    <div class="clear"></div>
</div>
<script>

    $(document).ready(function(e) {
        $.ajax({
            url:"{:U('getRegion')}",
            data:"",
            type:"POST",
            dataType:"html",
            success: function(data){
                $('#areabox').html(data);
            }
        });
    });
    function removnextAll(e){
        if($(e).next().length>0){
            removnextAll($(e).next());
            $(e).next().remove();
        }
    }
    function sendRegion(e){
        if(e.value>0){
            $.ajax({
                url:"{:U('getRegion')}",
                data:"fid="+e.value,
                type:"POST",
                dataType:"html",
                success: function(data){
                    removnextAll(e);
                    $(e).parent().append(data);
                }
            });
        }else{
            removnextAll(e);
        }
        return false;
    }

</script>
</body></html>